$input basecolor, horizioncolor, worldpos

#include <bgfx_shader.sh>
#include <Fuctions_MLYX.glsl>

void main(){

#if defined(OPAQUE)
    vec3 Position = worldpos;
    float Position_Shade = length(Position);

    vec3 ColorCaelo = CaeloFinal(basecolor.rgb,horizioncolor,clamp(pow2(Position_Shade)*4.0,0.0,1.0));

    ColorCaelo.rgb = pow(ColorCaelo.rgb, vec3(2.0,2.0,2.0));
    ColorCaelo = ACESToneMapping( ColorCaelo, 1.0 );
    ColorCaelo.rgb = pow(ColorCaelo.rgb, vec3(1.0 / 2.2, 1.0 / 2.2, 1.0 / 2.2));
    gl_FragColor = vec4(ColorCaelo, 1.0);
#else
    gl_FragColor = vec4(0.0,0.0,0.0,0.0);
#endif
}